<?php
include_once '/var/www/html/new/com.inc.php';
include_once("/var/www/html/new/d/class/Member.php");

include("/var/www/html/new/conf/yd.le.je");
$ydle=new yd_go_sql();
$ydle->connect(); 

$ac=$GLOBALS['_ac'];
$pw=$GLOBALS['_pw'];
$s = new SoapClient(null,array("location" => "http://localhost/open/openService/pft_insideMX.php","uri" => "www.16u.com?ac_16u=$ac|pw_16u=$pw|auth_16u=true"));
$memberID=$_SESSION['sid'];
$m=new Member($s,$memberID);
$m_info=$m->info();
$dtype=$m_info['dtype'];
if($dtype!=7){
    exit("您不是集团管理员，不能操作此项！");
}
$sql="select * from uu_tra_route order by edit_date desc";
$result=$GLOBALS['ydle']->query($sql);
while($row=$GLOBALS['ydle']->fetch_assoc($result)){
        $lists[]=$row;
     }
//print_r($lists);

$li_id=$_REQUEST['id'];
$action=$_REQUEST['action'];
$topic=$_REQUEST['topic'];
$content=$_REQUEST['content'];
$time=date('Y-m-d H:i:s');
if(isset($_REQUEAT['allpublish'])&&count($li_id)<3){
    echo "请选择三个路线";
    exit;
}
        for($i=0;i<count($li_id);$i++){
        if($action=='save'){
            $sql = "update uu_tra_route set topic='$topic',edit_date='$edit_date',content='$content' where id=$id";
            $result=$GLOBALS['ydle']->query($sql);
            echo "保存成功";
        }else if($action=='publish'){
            $sql="update uu_tra_route set topic='$topic',edit_date='$edit_date',content='$content',status='1' where id=$id";
            $result=$GLOBALS['ydle']->query($sql);
            echo "发布成功";
        }
        }

?>